using System;
using System.Collections.Generic;

namespace Test2.Models
{
    public partial class Diver
    {
        public static int Hasher = 1;
        public int Id { get; set; }
        public string Name { get; set; }
        public virtual ICollection<Jump> Jumps { get; set; }

        public Diver()
        {
            this.Jumps = new List<Jump>();
        }

        internal void AddJump(float height, int difficulty)
        {
            this.Jumps.Add(new Jump { Height = height, DiveType = (DiveTypes)difficulty, DiverId = this.Id, Id = Convert.ToInt32(this.Id.ToString() + GetHash().ToString()) });
        }

        int GetHash()
        {
            return Hasher++;
        }
    }
}
